import ReactDOM from 'react-dom/client';
import App from '@src/App'
import { Provider } from 'react-redux';
import store from './store';
import { ThunkDispatch } from 'redux-thunk';
import { PersistGate } from "redux-persist/integration/react";
import { persistStore } from "redux-persist";
import { ToastContainer } from "react-toastify";
import "bulma/css/bulma.css";
import "@fortawesome/fontawesome-free/css/all.min.css";

import "react-toastify/dist/ReactToastify.css";
const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(

  <Provider store={store}>
    <PersistGate persistor={persistStore(store)}>
    <App/>     
    <ToastContainer />
    </PersistGate>
  </Provider>

);

export type AppState = ReturnType<typeof store.getState>

export type AppDispatch = typeof store.dispatch

export type AppThunkDispatch = ThunkDispatch<AppState,void,Parameters<AppDispatch>[0]>


